# pooling 池化层的作用是使得每层特征图大小变小
import torch
from torch import nn
from torch.nn import functional as F

#X = torch.randn(1,1,2,2) #BCHW
x = torch.tensor([[[[0,1,2],
                    [3,4,5],
                    [6,7,8]]]]).float()
mp = nn.MaxPool2d(kernel_size=2,stride=1,padding=0) # 平均池化和最大池化，不改变特征层数
print(mp(x))